#ifndef MOCHA_DETAIL_MEMORY_HPP_INCLUDED
#define MOCHA_DETAIL_MEMORY_HPP_INCLUDED

/**
 * @file 
 */

#include <cstdint>
#include "mocha/memory.h"
#include "mocha/detail/stride_detector.hpp"

/**
 * 
 * @param T 
 */
#define MOCHA_STRIDEOF(T) \
((sizeof(mocha::detail::stride_detector<T>) > sizeof(T)) ? sizeof(mocha::detail::stride_detector<T>) - sizeof(T) : sizeof(T))

namespace mocha {
/**
 * A strideof operator. Provides a mechanism for finding the stride of an aggregate (like a struct).
 * Use strideof<T>::stride to get the stride of T.
 * @param T Type whose stride should be calculated.
 */
template<typename T>
struct strideof {
	enum { stride = MOCHA_STRIDEOF(T) };
};
}

#endif

